#ifndef PCG_RUNTIME_H
#define PCG_RUNTIME_H

#include <stdio.h>
#include "symtab.h"
#include "expr.h"

typedef double (*pcg_runtime_fn_t)(pcg_exprlist_t *);

typedef struct _pcg_runtime_t {
	pcg_symtab_t *table;
} pcg_runtime_t;

pcg_runtime_t *pcg_runtime_create();
void pcg_runtime_delete();

void pcg_runtime_add_symbol(pcg_runtime_t *rt, char *name, int arity, pcg_runtime_fn_t functor);
//void pcg_runtime_remove_symbol(pcg_runtime_t *rt, char *name, int arity);

pcg_expr_t *pcg_runtime_expr_from_string(pcg_runtime_t *rt, char *s);
pcg_expr_t *pcg_runtime_expr_from_fp(pcg_runtime_t *rt, FILE *fp);
double pcg_runtime_eval_expr(pcg_runtime_t *rt, pcg_expr_t *e);

#endif // PCG_RUNTIME_H